package com.meilai.project.controller.web.reminder;


import com.meilai.project.dto.base.ApiResult;
import com.meilai.project.entity.reminder.ReminderConfig;
import com.meilai.project.service.reminder.ReminderConfigService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 提醒配置表 前端控制器
 * </p>
 *
 * @author xhy
 * @since 2022-12-15
 */
@RestController
@RequestMapping("api/web/reminder_config")
public class ReminderConfigController {

    @Autowired
    private ReminderConfigService reminderConfigService;

    @GetMapping("/list")
    @ApiModelProperty("提醒列表")
    public ApiResult<ReminderConfig> list() {
        return ApiResult.ok(reminderConfigService.list());
    }

    @PostMapping("/edit")
    @ApiModelProperty("修改")
    public ApiResult<ReminderConfig> edit(@RequestBody ReminderConfig config) {
        return ApiResult.ok(reminderConfigService.updateById(config));
    }
}
